ci: use srcdir != builddir by default, builddir under target/
authorColin Walters <walters@verbum.org>
Mon, 2 Jun 2025 20:34:16 +0000 (16:34 -0400)
committerColin Walters <walters@verbum.org>
Tue, 3 Jun 2025 14:21:47 +0000 (10:21 -0400)
This blends better with docker builds where we have a blanket
ignore of `target` in .dockerignore.

Right now we use git.mk to generate .gitignore and autotools
drop stuff all over the place.

Signed-off-by: Colin Walters <walters@verbum.org>
.cci.jenkinsfile
.github/workflows/rust.yml
ci/libbuild.sh
ci/prow/Dockerfile

index eb891ab4ebfef750da480867ef445b7082940ca0..bed0aa79f389f251a8856eb0aee560f3aae6a93f 100644 (file)
@@ -24,7 +24,7 @@ stage("Build") {
       stage("Unit tests") {
         try {
           shwrap("""
-            make check
+            make -C target/c check
           """)
         } finally {
             shwrap("cat test-suite.log || true")
@@ -32,11 +32,13 @@ stage("Build") {
         }
       }
       stage("Build installed tests") {
-        shwrap("make -C tests/kolainst")
+        shwrap("""
+           make -C tests/kolainst
+        """)
       }
       stage("Generate artifacts") {
         shwrap("""
-          make install DESTDIR=\$(pwd)/installed/rootfs
+          make -C target/c install DESTDIR=\$(pwd)/installed/rootfs
           make -C tests/kolainst install DESTDIR=\$(pwd)/installed/tests
           bash -c '. /usr/lib/os-release && echo \$VERSION_ID' >\$(pwd)/installed/buildroot-id
         """)
index 21ce65e1548a1c93d8f4e2d02dbcfbaaea1f8e0e..0e62cd5b4b7267aab666e0bffa83c22639c7ce3c 100644 (file)
@@ -55,7 +55,7 @@ jobs:
       - name: Build libostree
         run: ./ci/build.sh
       - name: Install libostree
-        run: make install
+        run: make -C target/c install
       - name: Rust build
         run: cargo test --no-run --verbose --features=${{ env['LATEST_LIBOSTREE'] }}
       - name: Run tests
index def327af9d1e843077b2c250be1af53d9d2900be..d5636805cb4fae230cfce68ac6eda27bb3e0f8ce 100644 (file)
@@ -6,6 +6,10 @@ OS_ID=$(. /etc/os-release; echo $ID)
 OS_ID_LIKE=$(. /etc/os-release; echo $ID ${ID_LIKE:-})
 OS_VERSION_ID=$(. /etc/os-release; echo $VERSION_ID)
 
+# Drop our content underneath target/ by default as it's already
+# ignored by rust
+BUILDDIR=target/c
+
 pkg_upgrade() {
     dnf -y distro-sync
 }
@@ -16,8 +20,9 @@ make() {
 
 build() {
     env NOCONFIGURE=1 ./autogen.sh
-    ./configure --sysconfdir=/etc --prefix=/usr --libdir=/usr/lib64 "$@"
-    make V=1
+    mkdir -p target/c
+    (cd target/c && ../../configure --sysconfdir=/etc --prefix=/usr --libdir=/usr/lib64 "$@")
+    make -C target/c V=1
 }
 
 pkg_install() {
index 8fee585a74e73479bc95e5eb5da61b62abc90c2a..40494256386bd2eec0acf1b409c97912654bc74d 100644 (file)
@@ -1,7 +1,8 @@
 FROM quay.io/coreos-assembler/fcos-buildroot:testing-devel as builder
 WORKDIR /src
 COPY . .
-RUN env ./ci/build.sh && make install DESTDIR=/cosa/component-install
+RUN ./ci/build.sh
+RUN make -C target/c install DESTDIR=/cosa/component-install
 RUN make -C tests/kolainst
 RUN make -C tests/kolainst install DESTDIR=/cosa/component-tests
 # Uncomment this to fake a build to test the code below